package com.whc.service.impl;

import com.whc.constant.RedisHeader;
import com.whc.dto.OrderDto;
import com.whc.entity.Goods;
import com.whc.entity.Orders;
import com.whc.mapper.GoodsMapper;
import com.whc.mapper.OrdersMapper;
import com.whc.service.OrdersService;
import com.whc.vo.GoodsVo;
import io.swagger.annotations.Authorization;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 韦红材
 * @ClassName OrderServiceImpl
 * @data 2024/12/27 20:14
 * @Version V1.0
 **/
@Service
public class OrderServiceImpl implements OrdersService {

    @Autowired
    private OrdersMapper ordersMapper;

    //todo 订单的类型
    @Override
    public void addOrder(OrderDto orderDto) {
        Orders order=new Orders();
        BeanUtils.copyProperties(orderDto,order);
        order.setCreateTime(LocalDateTime.now());
        order.setType(1);
        ordersMapper.insert(order);
    }



}
